包含min函数的栈： https://www.nowcoder.com/practice/4c776177d2c04c2494f2555c9fcc1e49?
class Solution {
  private:
    stack<int> data_stack; //数据栈
    stack<int> min_stack; //辅助栈
  public:
    void push(int value) 
    {
        data_stack.push(value);
        if (min_stack.size() == 0 || value < min_stack.top()) 
        {
            min_stack.push(value);
        } 
        else 
        { 
            //min_stack.size() != 0 && value >= min_stack.top()
            min_stack.push(min_stack.top());
        }
    }
    void pop() 
    {
        if (data_stack.size() == 0 || min_stack.size() == 0)
        {
            return;
        }
        data_stack.pop();
        min_stack.pop();
    }
    int top() 
    {
        return data_stack.top();
    }

    int min
    {
        return min_stack.top();
    }
};